/**
 * @desc 订单详情类
 */
export default class OrderDetail {
  /* public orderDetailId: number = 0; // 订单详情编号
  public productname: string = "noproduct"; // 订单详情中的商品名[顾客购买的商品]
  public price: number = 0; // 价格
  public count: number = 0; // 购买数里

  constructor(
    orderDetailId_: number,
    productname_: string,
    price_: number,
    count_: number
  ) {
    this.orderDetailId = orderDetailId_;
    this.productname = productname_;
    this.price = price_;
    this.count = count_;
  } */
  // TS4之前针对
  // 没有初始化的值，也没有在构造函数中明确给这个赋值的一种解决方案
  // 增加undefined类型
  public orderDetailId: number | undefined; // 写一个联合类型
  public productname: string | undefined;
  public price: number | undefined;
  public count: number | undefined;

  constructor(
    orderDetailId_: number,
    productname_: string,
    price_: number,
    count_: number
  ) {
    // this.orderDetailId = orderDetailId_;
    // this.productname = productname_;
    // this.price = price_;
    // this.count = count_;
  }
}
